﻿#include<iostream>
#include<vector>
using namespace std;
int main() {

	int userId;
	vector<int> studentId;

	studentId.assign(5, 100);//初始化

	studentId.clear();//清空数组

	cout << studentId.empty() << endl;//判断当前容器是否为空，是则返回1

	do {
		cout << "请输入学号：";
		cin >> userId;
		if (!userId)break;
		studentId.push_back(userId);
	} while (true);

	studentId.push_back(9600);//在后面插入数据

	cout << studentId.size() << endl;//获得当前元素总数

	cout << studentId.at(2) << endl;//获得目标序号的元素

	for (int x : studentId) {
		cout << x << endl;
	}
}